1. Field
Embodiments relate to software optimization.
2. Background
On-stack replacement (OSR) is a technique for optimizing software code while the code is executing. In particular, OSR is used to optimize software functions that implement long running loops. Long running loops may not ever complete, or may take a long time to complete. Many types of software use such loops. For example, server daemons, graphics processing software, and programming language interpreters all typically use long running loops in their implementation. Typically, these types of software may include many different levels of loops, often referred to as nested loops. However, when software includes nested loops there is a bias towards performing OSR at inner loops instead of outer loops. This may harm the quality of the optimizations that OSR performs.